﻿package mortal.game.view.friendBless.view.renderer
{
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import com.mui.utils.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.game.view.friendBless.view.data.*;
    import mortal.game.view.friendBless.view.util.*;
    import mortal.game.view.friendBless.view.view.*;

    public class FriendCongratulationCellRenderer extends GCellRenderer
    {
        private var _bg:ScaleBitmap;
        private var _rank:GTextFiled;
        private var _headSpr:FriendBlessHeadSpr;
        private var _roleName:GTextFiled;
        private var _exp:GTextFiled;
        private var _lingqi:GTextFiled;
        private var _blesses:GTextFiled;
        private var _blessData:FriendBlessData;

        public function FriendCongratulationCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.bg(0, 0, 744 - 120 + 7, 49, this, ImagesConst.RankingListBg);
            this._rank = UIFactory.gTextField("99", 9, 20 - 6, 23, 20, this);
            this._headSpr = UICompomentPool.getUICompoment(FriendBlessHeadSpr);
            this._headSpr.x = 36;
            this._headSpr.y = 4;
            this.addChild(this._headSpr);
            this._roleName = UIFactory.gTextField("人物名字七个字", 85, 20 - 6, 88, 20, this, GlobalStyle.textFormatBai.center());
            this._exp = UIFactory.gTextField("经验    999", 397 - 110 - 65, 20 - 6, 120, 20, this, GlobalStyle.textFormatBai);
            this._lingqi = UIFactory.gTextField("金币    999", 485 - 110 - 65, 20 - 6, 120, 20, this, GlobalStyle.textFormatBai);
            this._blesses = UIFactory.gTextField("恭喜朋友升级了啊！", 595 + 15 - 120, 20 - 6, 130, 20, this, GlobalStyle.textFormatHuang2);
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:int = 0;
            var _loc_3:String = null;
            super.data = param1;
            this._blessData = param1 as FriendBlessData;
            if (this._blessData)
            {
                this._rank.text = this._blessData.seq.toString();
                this._headSpr.data = this._blessData.miniPlayer;
                this._roleName.text = this._blessData.miniPlayer.name;
                this._exp.htmlText = HTMLUtil.addColor("经验    ", GlobalStyle.colorHuang2) + this._blessData.gainExp;
                this._lingqi.htmlText = HTMLUtil.addColor("金币    ", GlobalStyle.colorLan) + this._blessData.gainEnergy;
                _loc_2 = Math.random() * FriendBlessConst.BlessTalks.length;
                _loc_3 = FriendBlessConst.BlessTalks[_loc_2];
                this._blesses.text = _loc_3;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._bg.dispose();
            this._bg = null;
            this._rank.dispose();
            this._rank = null;
            this._headSpr.dispose();
            this._headSpr = null;
            this._roleName.dispose();
            this._roleName = null;
            this._exp.dispose();
            this._exp = null;
            this._lingqi.dispose();
            this._lingqi = null;
            this._blesses.dispose();
            this._blesses = null;
            this._blessData = null;
            return;
        }// end function

    }
}
